package com.ymatou.app.home.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.home.parameter.GetCategoryListBean;
import com.ymatou.app.home.service.GetCategoryListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
/**
*获取首页分类列表信息接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetCategoryList{
	private static GetCategoryListBean getcategorylistBean;
	private static GetCategoryListCall getcategorylistCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取首页分类列表信息接口");
	}

	@Before
	public void caseUp() {
		getcategorylistBean=new GetCategoryListBean();
		getcategorylistCall=new GetCategoryListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getcategorylistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetCategoryList_001() {
		Logger.start(true,"获取首页分类列表信息成功");
		try {
			getcategorylistBean.setPageIndex(1);
			getcategorylistBean.setUserId(1113);
			getcategorylistBean.setCookieId("autotest");
			getcategorylistBean.setIDFA("autotest");
			getcategorylistBean.setIMEI("autotest");
			getcategorylistCall.setData(getcategorylistBean);
			getcategorylistCall.callService();			
			Logger.comment("getcategorylistCall send:" + getcategorylistCall.getEntityString());
			Logger.comment("getcategorylistCall response:" + getcategorylistCall.getReturnData());
			
			Logger.verifyNotNull(getcategorylistCall.getCategorylist(), "验证返回的categorylist不为空");
			
			Logger.debug("---:"+getcategorylistCall.getCategorylist());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}